package Exam.String;

import javax.xml.transform.Source;
import java.util.Scanner;

public class StringD5 {
    public static void main(String[] args) {
        //遍历字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串");
        String str = sc.next();
        //进行遍历
        //快捷：scr.length.fori
        for (int i = 0; i < str.length(); i++) {
            //charAt 根据索引返回字符
            //i 表示字符串中每一个索引
            char c = str.charAt(i);
            System.out.println(c);
        }
    }
}
